package com.siki.controller;


import com.siki.utils.EnumUtil;
import com.siki.config.jsonConfig.JsonResult;
import com.siki.pojo.enumerate.DepartmentPosition;
import com.siki.pojo.enumerate.ResultType;
import com.siki.vo.EnumRoleVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;


/**
 * @Author Siki
 * @Date 2020/4/23
 */
@RestController
@Api(tags = "枚举接口")
@RequestMapping("/getEnum")
@CrossOrigin
public class EnumController {

    @ApiOperation(value = "[查询] - 获取部门职位信息",httpMethod = "GET",consumes = "application/json",response = EnumRoleVO.class)
    @GetMapping("/getRole")
    public JsonResult getRole(){
        return JsonResult.success(EnumRoleVO.EnumRoleVOList(DepartmentPosition.getDepartment()));
    }

    @ApiOperation(value = "[数据映射] - 部门职位信息数据映射接口",httpMethod = "GET",consumes = "application/json")
    @GetMapping("/getType")
    public JsonResult getType(){
        return JsonResult.success(EnumUtil.getEnumTypeJsonArray(DepartmentPosition.class));
    }

    @ApiOperation(value = "[查询接口] - 获取所有面试状态",httpMethod = "GET",consumes = "application/json")
    @RequestMapping(value = "/getResult",method = RequestMethod.GET)
    public JsonResult getResult(){
        return JsonResult.success(EnumUtil.getEnumTypeJsonArray(ResultType.class));
    }
}
